package com.csxh.web.handler.eshop;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.csxh.web.model.eshop.Product;
import com.csxh.web.service.eshop.ProductService;

@Controller
public class ProductHandler {

	
	@Autowired
	private ProductService productService;
	
	@RequestMapping("/product")
	public String list(Model model,Integer id) {
		Product p=productService.findOneById(id);
		
		System.out.println(p.getIsbn());
		
		model.addAttribute("product", p);
		
		return "product";
	}
}
